import fetchJsonp from 'fetch-jsonp'

import React, { Component } from 'react'

export default class Jsonp extends Component {
    constructor(props) {
      super(props)
    
      this.state = {
         list:[]
      }
    }
    

    componentDidMount() {
        this.getjsonp()
    }

    getjsonp = () => {
        var api="http://www.phonegap100.com/appapi.php?a=getPortalList&catid=20";
        fetchJsonp(api)
          .then(function(response) {
            return response.json()
          }).then(function(json) {
            console.log(json)
          }).catch(function(ex) {
            console.log(ex)
          })
       
    }

    render() {
        return (
            // <ul>
            //     {this.state.list.map((val,key)=>{
            //         return <li key={key}>{val.title}</li>
            //     })}
            // </ul>
            <div></div>
        )
    }
}

